home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume5 / mpss / patch1 < prev    next >
Encoding:
Internet Message Format  |  1988-08-17  |  50.8 KB

  1. Path: uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!tektronix!tekgen!tekred!games
  2. From: games@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v05i055:  mpss - multi-player Star Trek game, Patch1
  5. Message-ID: <2944@tekred.TEK.COM>
  6. Date: 17 Aug 88 18:52:54 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 1704
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted by: Peer Schmitz <peer@cs.kl.ac.uk>
  12. Comp.sources.games: Volume 5, Issue 55
  13. Archive-name: mpss/Patch1
  14.  
  15.     [This and the following patch bring mpss upto version 1.4. This
  16.      patch contains all of the code changes, the next one all of the
  17.      documentation changes. Feed this article to patch while in your
  18.      mpss source directory.  -br]
  19.  
  20. [[            MPSS VERSION 1.4
  21. Hello Folks !
  22. Here is the, new, revised game. Hope it will go ok on your machine.
  23. Incase of any problems, mail me. This is Version 1.4. If you have 
  24. a lower or unmarked version of this game, replace it by this. It's worth it.
  25. Some bugs are fixed. Re-read the rules file. Still BSD Unix dependent.]]
  26.  
  27. #! /bin/sh
  28. # This is a shell archive.  Remove anything before this line, then unpack
  29. # it by saving it into a file and typing "sh file".  To overwrite existing
  30. # files, type "sh file -c".  You can also feed this as standard input via
  31. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  32. # will see the following message at the end:
  33. #        "End of shell archive."
  34. # Contents:  Patches01
  35. # Wrapped by billr@saab on Wed Aug 17 11:50:06 1988
  36. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  37. if test -f 'Patches01' -a "${1}" != "-c" ; then 
  38.   echo shar: Will not clobber existing file \"'Patches01'\"
  39. else
  40. echo shar: Extracting \"'Patches01'\" \(48433 characters\)
  41. sed "s/^X//" >'Patches01' <<'END_OF_FILE'
  42. X*** ../../mpss/aliens.c    Thu Jun 23 10:22:05 1988
  43. X--- aliens.c    Wed Jul 27 14:36:06 1988
  44. X***************
  45. X*** 1,3 ****
  46. X--- 1,18 ----
  47. X+ 
  48. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  49. X+ /*******************************************************************************
  50. X+ ********************************************************************************
  51. X+ ********************************************************************************
  52. X+ 
  53. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  54. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  55. X+ 
  56. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  57. X+ 
  58. X+ 
  59. X+ ********************************************************************************
  60. X+ ********************************************************************************
  61. X+ *******************************************************************************/
  62. X  #include "ships.h"
  63. X  #include "header.h"
  64. X  
  65. X***************
  66. X*** 89,96 ****
  67. X              i=rand()%100;
  68. X              if (i<6)
  69. X                  {
  70. X!                 fire_torpedo(cp,'6',0);
  71. X                  cp->messindex=0;
  72. X                  i=rand()%100;
  73. X                  if (i<50)
  74. X                      cp->yvel=1;
  75. X--- 104,117 ----
  76. X              i=rand()%100;
  77. X              if (i<6)
  78. X                  {
  79. X!                 if (cp->planets[1]!=0)
  80. X!                     {
  81. X!                     fire_torpedo(cp,'9',0);
  82. X!                     fire_torpedo(cp,'9',0);
  83. X!                     } else
  84. X!                     fire_torpedo(cp,'6',0);
  85. X                  cp->messindex=0;
  86. X+                 cp->planets[1]=0;
  87. X                  i=rand()%100;
  88. X                  if (i<50)
  89. X                      cp->yvel=1;
  90. X***************
  91. X*** 100,107 ****
  92. X              i=rand()%100;
  93. X              if (i<6)
  94. X                  {
  95. X!                 fire_torpedo(cp,'4',0);
  96. X                  cp->messindex=0;
  97. X                  i=rand()%100;
  98. X                  if (i<50)
  99. X                      {
  100. X--- 121,134 ----
  101. X              i=rand()%100;
  102. X              if (i<6)
  103. X                  {
  104. X!                 if (cp->planets[1]!=0)
  105. X!                     {
  106. X!                     fire_torpedo(cp,'7',0);
  107. X!                     fire_torpedo(cp,'7',0);
  108. X!                     } else
  109. X!                     fire_torpedo(cp,'4',0);
  110. X                  cp->messindex=0;
  111. X+                 cp->planets[1]=0;
  112. X                  i=rand()%100;
  113. X                  if (i<50)
  114. X                      {
  115. X***************
  116. X*** 140,146 ****
  117. X  register struct player *x;
  118. X  if (noofplayers>1) return(0);
  119. X  x=startlist;
  120. X! while (x!=NULL && x->id!=enemyid) x=x->next;
  121. X  if (x!=NULL) lockonalien(x,who);
  122. X  }
  123. X  
  124. X--- 167,173 ----
  125. X  register struct player *x;
  126. X  if (noofplayers>1) return(0);
  127. X  x=startlist;
  128. X! while (x!=NULL && (x->id!=enemyid || x->messindex==1)) x=x->next;
  129. X  if (x!=NULL) lockonalien(x,who);
  130. X  }
  131. X  
  132. X***************
  133. X*** 153,158 ****
  134. X--- 180,195 ----
  135. X  
  136. X  i=rand()%1000;
  137. X  if (i>500) cp->weaponselect=0; else cp->weaponselect=1;
  138. X+ if (i>500)
  139. X+     {
  140. X+     if (i>750) cp->screenenergy=6; else cp->screenenergy=7;
  141. X+     } else
  142. X+     {
  143. X+     if (i>250) cp->screenenergy=5; else cp->screenenergy=8;
  144. X+     }
  145. X+ i=rand()%100;
  146. X+ if (i>30) cp->planets[1]=0; else
  147. X+     cp->planets[1]=abs((rand()%10)-5);
  148. X  if (who==NULL)
  149. X      {
  150. X      x=startlist;
  151. X***************
  152. X*** 180,201 ****
  153. X  autopilotalien(cp)
  154. X  register struct player *cp;
  155. X  {
  156. X  if (cp->weaponselect==0)
  157. X      {
  158. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos-7))
  159. X          {
  160. X!     if (cp->xpos<(cp->channel[1].enemy->xpos-7)) cp->xvel=1; else cp->xvel= -1;
  161. X          } else cp->xvel=0;
  162. X      } else
  163. X      {
  164. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos+6))
  165. X          {
  166. X!     if (cp->xpos<(cp->channel[1].enemy->xpos+6)) cp->xvel=1; else cp->xvel= -1;
  167. X          } else cp->xvel=0;
  168. X      }
  169. X! if (cp->ypos!=cp->channel[1].enemy->ypos)
  170. X          {
  171. X!     if (cp->ypos<cp->channel[1].enemy->ypos) cp->yvel=1; else cp->yvel= -1;
  172. X          } else cp->yvel=0;
  173. X  
  174. X  /* arrival at location*/
  175. X--- 217,240 ----
  176. X  autopilotalien(cp)
  177. X  register struct player *cp;
  178. X  {
  179. X+ int g;
  180. X+ g = cp->planets[1];
  181. X  if (cp->weaponselect==0)
  182. X      {
  183. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos-cp->screenenergy))
  184. X          {
  185. X!     if (cp->xpos<(cp->channel[1].enemy->xpos-cp->screenenergy)) cp->xvel=1; else cp->xvel= -1;
  186. X          } else cp->xvel=0;
  187. X      } else
  188. X      {
  189. X!     if (cp->xpos!=(cp->channel[1].enemy->xpos+cp->screenenergy))
  190. X          {
  191. X!     if (cp->xpos<(cp->channel[1].enemy->xpos+cp->screenenergy)) cp->xvel=1; else cp->xvel= -1;
  192. X          } else cp->xvel=0;
  193. X      }
  194. X! if (cp->ypos!=(cp->channel[1].enemy->ypos-g))
  195. X          {
  196. X!     if (cp->ypos<(cp->channel[1].enemy->ypos-g)) cp->yvel=1; else cp->yvel= -1;
  197. X          } else cp->yvel=0;
  198. X  
  199. X  /* arrival at location*/
  200. X*** ../../mpss/auto.c    Thu Jun 23 10:22:05 1988
  201. X--- auto.c    Wed Jul 27 14:36:06 1988
  202. X***************
  203. X*** 1,3 ****
  204. X--- 1,5 ----
  205. X+ 
  206. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  207. X  /*******************************************************************************
  208. X  ********************************************************************************
  209. X  ********************************************************************************
  210. X*** ../../mpss/collision.c    Thu Jun 23 10:22:05 1988
  211. X--- collision.c    Wed Jul 27 14:36:06 1988
  212. X***************
  213. X*** 1,4 ****
  214. X--- 1,5 ----
  215. X  
  216. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  217. X  /*******************************************************************************
  218. X  ********************************************************************************
  219. X  ********************************************************************************
  220. X***************
  221. X*** 14,19 ****
  222. X--- 15,36 ----
  223. X  *******************************************************************************/
  224. X  #include "header.h"
  225. X  
  226. X+ bounceplayer(cp)
  227. X+ register struct player *cp;
  228. X+ {
  229. X+     if (cp->xvel<0) cp->xvel=1; 
  230. X+     else
  231. X+         {
  232. X+         if (cp->xvel>0) cp->xvel= -1;
  233. X+         }
  234. X+     if (cp->yvel<0) cp->yvel=1;
  235. X+     else
  236. X+         {
  237. X+         if (cp->yvel>0) cp->yvel= -1;
  238. X+         }
  239. X+     plotvelocity(cp);
  240. X+ }
  241. X+ 
  242. X  collision(cp,c)
  243. X  register struct player *cp;
  244. X  char c;
  245. X***************
  246. X*** 35,55 ****
  247. X      }
  248. X  case 'O' :
  249. X      {
  250. X!     plot1(cp,"   You  crashed  into  a planet.  Oh  dear,  Oh  dear,   ");
  251. X!     plot2(cp,"   The crater you left was 12 miles wide. Your'e Dead!   ");
  252. X!     if (cp->reason>0) cp->reason= -1;
  253. X!     finish(cp);
  254. X      break;
  255. X      }
  256. X  case '.' :
  257. X      {
  258. X-     cp->maxenergy -= 30;
  259. X-     cp->energy -= 30;
  260. X-     plotenergy(cp);
  261. X-     plotmaxenergy(cp);
  262. X      plot1(cp,"    You collided with a star. Warp capability has been   ");
  263. X      plot2(cp,"    reduced by 30, and your  energy  is  30 lower now.   ");
  264. X!     if (cp->stat!=5) plotstatus(cp,4);
  265. X      break;
  266. X      }
  267. X  case 'k' :
  268. X--- 52,86 ----
  269. X      }
  270. X  case 'O' :
  271. X      {
  272. X!     plot1(cp,"You struck the planet. The crater you left was 24 miles  ");
  273. X!     plot2(cp,"wide. You lost 499 energy units. WARNING : ENERGY LOW!!  ");
  274. X!     cp->energy -= 499;
  275. X!     cp->maxenergy -= 499;
  276. X!     plotbattleenergy(cp);
  277. X!     bounceplayer(cp);
  278. X!     if (cp->energy<0 && cp->reason>0) 
  279. X!             {
  280. X!             cp->reason= -1;
  281. X!             finish(cp);
  282. X!             }
  283. X      break;
  284. X      }
  285. X  case '.' :
  286. X      {
  287. X      plot1(cp,"    You collided with a star. Warp capability has been   ");
  288. X      plot2(cp,"    reduced by 30, and your  energy  is  30 lower now.   ");
  289. X!     cp->maxenergy -= 30;
  290. X!     cp->energy -= 30;
  291. X!     plotbattleenergy(cp);
  292. X!     bounceplayer(cp);
  293. X!     if (cp->energy<0 && cp->reason>0) 
  294. X!             {
  295. X!             cp->reason= -6;
  296. X!             finish(cp);
  297. X!             } else
  298. X!             {
  299. X!             if (cp->stat!=5) plotstatus(cp,4);
  300. X!             }
  301. X      break;
  302. X      }
  303. X  case 'k' :
  304. X***************
  305. X*** 56,66 ****
  306. X      {
  307. X      cp->maxenergy -= 100;
  308. X      cp->energy -= 100;
  309. X-     plotenergy(cp);
  310. X-     plotmaxenergy(cp);
  311. X      plot1(cp,"    You collided with a klingon mevisic mine...          ");
  312. X      plot2(cp,"    Energy and Maxenergy have dropped by 100.            ");
  313. X!     if (cp->stat!=5) plotstatus(cp,4);
  314. X      break;
  315. X      }
  316. X  case '#' :
  317. X--- 87,104 ----
  318. X      {
  319. X      cp->maxenergy -= 100;
  320. X      cp->energy -= 100;
  321. X      plot1(cp,"    You collided with a klingon mevisic mine...          ");
  322. X      plot2(cp,"    Energy and Maxenergy have dropped by 100.            ");
  323. X!     plotbattleenergy(cp);
  324. X!     bounceplayer(cp);
  325. X!     if (cp->energy<0 && cp->reason>0) 
  326. X!             {
  327. X!             cp->reason= -8;
  328. X!             finish(cp);
  329. X!             } else
  330. X!             {
  331. X!             if (cp->stat!=5) plotstatus(cp,4);
  332. X!             }
  333. X      break;
  334. X      }
  335. X  case '#' :
  336. X***************
  337. X*** 67,77 ****
  338. X      {
  339. X      cp->maxenergy -= 400;
  340. X      cp->energy -= 400;
  341. X-     plotenergy(cp);
  342. X-     plotmaxenergy(cp);
  343. X      plot1(cp,"    You collided with a Romulan Warning buoy.            ");
  344. X      plot2(cp,"    Energy and Maxenergy have dropped by 400.            ");
  345. X!     if (cp->stat!=5) plotstatus(cp,4);
  346. X      break;
  347. X      }
  348. X  case 'o' :
  349. X--- 105,122 ----
  350. X      {
  351. X      cp->maxenergy -= 400;
  352. X      cp->energy -= 400;
  353. X      plot1(cp,"    You collided with a Romulan Warning buoy.            ");
  354. X      plot2(cp,"    Energy and Maxenergy have dropped by 400.            ");
  355. X!     plotbattleenergy(cp);
  356. X!     bounceplayer(cp);
  357. X!     if (cp->energy<0 && cp->reason>0) 
  358. X!             {
  359. X!             cp->reason= -7;
  360. X!             finish(cp);
  361. X!             } else
  362. X!             {
  363. X!             if (cp->stat!=5) plotstatus(cp,4);
  364. X!             }
  365. X      break;
  366. X      }
  367. X  case 'o' :
  368. X*** ../../mpss/consoleplots.c    Thu Jun 23 10:22:05 1988
  369. X--- consoleplots.c    Wed Jul 27 14:36:06 1988
  370. X***************
  371. X*** 1,4 ****
  372. X--- 1,5 ----
  373. X  
  374. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  375. X  /*******************************************************************************
  376. X  ********************************************************************************
  377. X  ********************************************************************************
  378. X***************
  379. X*** 108,113 ****
  380. X--- 109,115 ----
  381. X  char energy[5];    
  382. X  
  383. X  if ((cp->id==ROMID)||(cp->id==KLINGID)) return(0);
  384. X+ cp->screenenergy=cp->energy;
  385. X  if (cp->energy>0)
  386. X  {
  387. X  sprintf(energy," %4d",cp->energy);
  388. X***************
  389. X*** 131,136 ****
  390. X--- 133,139 ----
  391. X  char energy[5];    
  392. X  
  393. X  if ((d->id==ROMID)||(d->id==KLINGID)) return(0);
  394. X+ d->screenenergy=d->energy;
  395. X  sprintf(energy," %4d",d->energy);
  396. X  poscurs(d,14,7); 
  397. X  write(d->fd,energy,5);
  398. X*** ../../mpss/cross.c    Thu Jun 23 10:22:05 1988
  399. X--- cross.c    Wed Jul 27 14:36:07 1988
  400. X***************
  401. X*** 1,4 ****
  402. X--- 1,5 ----
  403. X  
  404. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  405. X  /*******************************************************************************
  406. X  ********************************************************************************
  407. X  ********************************************************************************
  408. X***************
  409. X*** 164,170 ****
  410. X  poscurs(cp,20,7);
  411. X  write(cp->fd, "d,f => dock/undock, 1..9 => fire weapon, p => weapon sel.",57); 
  412. X  poscurs(cp,20,8);
  413. X! write(cp->fd, "    q => show quadrant, w => show warp, e => show energy ",57); 
  414. X  poscurs(cp,20,9);
  415. X  write(cp->fd, "      c => cloaking device on/off, v => shields on/off   ",57); 
  416. X  poscurs(cp,20,10);
  417. X--- 165,171 ----
  418. X  poscurs(cp,20,7);
  419. X  write(cp->fd, "d,f => dock/undock, 1..9 => fire weapon, p => weapon sel.",57); 
  420. X  poscurs(cp,20,8);
  421. X! write(cp->fd, "    q => show exact quadrant,   e => show exact energy   ",57); 
  422. X  poscurs(cp,20,9);
  423. X  write(cp->fd, "      c => cloaking device on/off, v => shields on/off   ",57); 
  424. X  poscurs(cp,20,10);
  425. X*** ../../mpss/cursor.c    Thu Jun 23 10:22:06 1988
  426. X--- cursor.c    Wed Jul 27 14:36:07 1988
  427. X***************
  428. X*** 1,4 ****
  429. X--- 1,5 ----
  430. X  
  431. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  432. X  /*******************************************************************************
  433. X  ********************************************************************************
  434. X  ********************************************************************************
  435. X***************
  436. X*** 44,50 ****
  437. X          return(0);
  438. X          break;
  439. X      case 1 :
  440. X! fprintf(stderr,"                 Found entry for automatic terminal option\n");
  441. X          break;
  442. X      default:
  443. X          fprintf(stderr,"get_termcap_entry:Somethings wrong!!\n");
  444. X--- 45,51 ----
  445. X          return(0);
  446. X          break;
  447. X      case 1 :
  448. X! fprintf(stderr,"                Found entry for automatic terminal option\n");
  449. X          break;
  450. X      default:
  451. X          fprintf(stderr,"get_termcap_entry:Somethings wrong!!\n");
  452. X*** ../../mpss/dock.c    Thu Jun 23 10:22:06 1988
  453. X--- dock.c    Wed Jul 27 14:36:07 1988
  454. X***************
  455. X*** 1,4 ****
  456. X--- 1,5 ----
  457. X  
  458. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  459. X  /*******************************************************************************
  460. X  ********************************************************************************
  461. X  ********************************************************************************
  462. X***************
  463. X*** 27,33 ****
  464. X          dockingok=ON;
  465. X  if (dockingok==OFF)
  466. X      {
  467. X!     plot1(cp,"   Your'e not beside a federation starbase Captain.      ");
  468. X      plot2(cp,"                                                         ");
  469. X      } else
  470. X      {
  471. X--- 28,34 ----
  472. X          dockingok=ON;
  473. X  if (dockingok==OFF)
  474. X      {
  475. X!     plot1(cp," Your'e not beside any starbase or spacedock Captain.    ");
  476. X      plot2(cp,"                                                         ");
  477. X      } else
  478. X      {
  479. X*** ../../mpss/keyscan.c    Thu Jun 23 10:22:06 1988
  480. X--- keyscan.c    Wed Jul 27 14:36:07 1988
  481. X***************
  482. X*** 1,4 ****
  483. X--- 1,5 ----
  484. X  
  485. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  486. X  /*******************************************************************************
  487. X  ********************************************************************************
  488. X  ********************************************************************************
  489. X*** ../../mpss/main.c    Thu Jun 23 10:22:06 1988
  490. X--- main.c    Wed Jul 27 14:36:07 1988
  491. X***************
  492. X*** 1,4 ****
  493. X--- 1,5 ----
  494. X  
  495. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  496. X  /*******************************************************************************
  497. X  ********************************************************************************
  498. X  ********************************************************************************
  499. X***************
  500. X*** 16,21 ****
  501. X--- 17,40 ----
  502. X  #include "files.h"
  503. X  #include "header.h"
  504. X  
  505. X+ lognewprocess(procno)
  506. X+ int procno;
  507. X+ {
  508. X+ FILE *f, *fopen();
  509. X+ char arr[15];
  510. X+ 
  511. X+     if ((f=fopen(PROCESSFILE,"a"))==NULL)
  512. X+         {
  513. X+         fprintf(stdout,"slave.c : error trying to log processnumber\n");
  514. X+         die();
  515. X+         } else
  516. X+         {
  517. X+         sprintf(arr,"%d\n",procno);
  518. X+         fputs(arr,f);
  519. X+         fclose(f);
  520. X+         }
  521. X+ }
  522. X+ 
  523. X  checkmasterpidfile()
  524. X  {
  525. X  int rpid,masterpid;
  526. X***************
  527. X*** 40,46 ****
  528. X      die();
  529. X      }
  530. X  signal(SIGALRM,checkmasterpidfile);
  531. X! alarm(180);
  532. X  }
  533. X  
  534. X  
  535. X--- 59,65 ----
  536. X      die();
  537. X      }
  538. X  signal(SIGALRM,checkmasterpidfile);
  539. X! alarm(60);
  540. X  }
  541. X  
  542. X  
  543. X***************
  544. X*** 80,91 ****
  545. X  main()
  546. X  {
  547. X  register struct player *cp;
  548. X! int f,o;
  549. X  register int x,y,x1,x2,y1,y2,xx1,xx2,yy1,yy2,xold,yold,xnew,ynew;
  550. X  register char c;
  551. X  register struct torpedo *torpedo;
  552. X! register int xx,test;
  553. X      
  554. X  test=1;
  555. X  f=umask(000);
  556. X  killcontrol();
  557. X--- 99,111 ----
  558. X  main()
  559. X  {
  560. X  register struct player *cp;
  561. X! int sener,ener,f,o;
  562. X  register int x,y,x1,x2,y1,y2,xx1,xx2,yy1,yy2,xold,yold,xnew,ynew;
  563. X  register char c;
  564. X  register struct torpedo *torpedo;
  565. X! register int loop,xx,test;
  566. X      
  567. X+ lognewprocess(getpid());
  568. X  test=1;
  569. X  f=umask(000);
  570. X  killcontrol();
  571. X***************
  572. X*** 124,129 ****
  573. X--- 144,167 ----
  574. X               goto goonlabel;
  575. X               }
  576. X      cp->clflg=OFF;
  577. X+ 
  578. X+ 
  579. X+ 
  580. X+ /**********************TUNING DELAY LOOP FOR SINGLE-PLAYER-MODE****************/
  581. X+ /*
  582. X+ Alter the number  (10) below. Increase it to slow down the game, decrease it
  583. X+ to speed it up, or delete the loop as a whole if your machine runs mpss to
  584. X+ slowly in single player mode.
  585. X+    
  586. X+                         This number > v 
  587. X+                                     v
  588. X+                             v                
  589. X+ if (noofplayers==1) for (loop=1; loop < 10; loop++);
  590. X+ */
  591. X+ /**********************TUNING DELAY LOOP FOR SINGLE-PLAYER-MODE****************/
  592. X+     
  593. X+ 
  594. X+ 
  595. X      ioctl(cp->fd,FIONREAD,&noofchars);
  596. X      if (noofchars>0) processinput(cp,&noofchars);
  597. X      if ((cp->stat==5)&&(cp->flyto>=0)&&(cp->flyto<4)) auto_pilot(cp);
  598. X***************
  599. X*** 273,282 ****
  600. X  
  601. X  if ((x<58)||(x>899)||(y<19)||(y>899))
  602. X      {
  603. X!     if (x<58) cp->xvel=1;
  604. X!     if (x>899) cp->xvel= -1;
  605. X!     if (y<19) cp->yvel=1;
  606. X!     if (y>899) cp->yvel= -1;
  607. X      } else 
  608. X      {
  609. X      if ((c=inuniv(x,y))!=NULL) collision(cp,c);
  610. X--- 311,336 ----
  611. X  
  612. X  if ((x<58)||(x>899)||(y<19)||(y>899))
  613. X      {
  614. X!     if (x<58) 
  615. X!         {
  616. X!         cp->xvel=1;
  617. X!         plotvelocity(cp);
  618. X!         }
  619. X!     if (x>899) 
  620. X!         {
  621. X!         cp->xvel= -1;
  622. X!         plotvelocity(cp);
  623. X!         }
  624. X!     if (y<19) 
  625. X!         {
  626. X!         cp->yvel=1;
  627. X!         plotvelocity(cp);
  628. X!         }
  629. X!     if (y>899) 
  630. X!         {
  631. X!         cp->yvel= -1;
  632. X!         plotvelocity(cp);
  633. X!         }
  634. X      } else 
  635. X      {
  636. X      if ((c=inuniv(x,y))!=NULL) collision(cp,c);
  637. X***************
  638. X*** 342,349 ****
  639. X  
  640. X      skipenergy:
  641. X      
  642. X!     if ((cp->energy==75)&&(storm==OFF)) flare();
  643. X!     if (cp->energy<100) plotenergy(cp);
  644. X      /*ENERGY CALCULATION*/
  645. X  goonlabel:
  646. X      if (cp->impulsemove>0) {
  647. X--- 396,410 ----
  648. X  
  649. X      skipenergy:
  650. X      
  651. X!     ener=cp->energy;
  652. X!     sener=cp->screenenergy;
  653. X!     
  654. X!     if ((ener==75)&&(storm==OFF)) flare();
  655. X!     if (ener!=sener)
  656. X!         {
  657. X!     if ((ener<=100) || (((ener%50)==0)) || (ener==cp->maxenergy))
  658. X!         plotenergy(cp);
  659. X!         }
  660. X      /*ENERGY CALCULATION*/
  661. X  goonlabel:
  662. X      if (cp->impulsemove>0) {
  663. X*** ../../mpss/mpss.c    Thu Jun 23 10:22:06 1988
  664. X--- mpss.c    Wed Jul 27 14:36:08 1988
  665. X***************
  666. X*** 1,4 ****
  667. X--- 1,18 ----
  668. X  
  669. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  670. X+ /*******************************************************************************
  671. X+ ********************************************************************************
  672. X+ ********************************************************************************
  673. X+ 
  674. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  675. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  676. X+ 
  677. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  678. X+ 
  679. X+ 
  680. X+ ********************************************************************************
  681. X+ ********************************************************************************
  682. X+ *******************************************************************************/
  683. X  #include <stdio.h>
  684. X  #include "files.h"
  685. X  
  686. X*** ../../mpss/mpssclean.c    Thu Jun 23 10:22:06 1988
  687. X--- mpssclean.c    Wed Jul 27 14:36:08 1988
  688. X***************
  689. X*** 1,3 ****
  690. X--- 1,18 ----
  691. X+ 
  692. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  693. X+ /*******************************************************************************
  694. X+ ********************************************************************************
  695. X+ ********************************************************************************
  696. X+ 
  697. X+ PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  698. X+ THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  699. X+ 
  700. X+         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  701. X+ 
  702. X+ 
  703. X+ ********************************************************************************
  704. X+ ********************************************************************************
  705. X+ *******************************************************************************/
  706. X  #include <stdio.h>
  707. X  #include "files.h"
  708. X  #include <signal.h>
  709. X***************
  710. X*** 5,14 ****
  711. X  
  712. X  main()
  713. X  {
  714. X! int rpid;
  715. X  char string[15];
  716. X  char remove[80];
  717. X  FILE *f, *fopen();
  718. X  
  719. X  sprintf(remove,"rm %s\n",PLAYERFILE);
  720. X  system(remove);
  721. X--- 20,36 ----
  722. X  
  723. X  main()
  724. X  {
  725. X! int rpid,procno;
  726. X  char string[15];
  727. X  char remove[80];
  728. X+ char arr[15];
  729. X  FILE *f, *fopen();
  730. X+         
  731. X+ fprintf(stdout,"            MPSS CLEANUP PROGRAM..\n");
  732. X+ fprintf(stdout," This program quits any game currently running,\n");
  733. X+ fprintf(stdout," and/or it cleans up files and processes  left \n");
  734. X+ fprintf(stdout,"on your system incase MPSS was stopped abnormally.\n");
  735. X+ fprintf(stdout,"     Please ignore any error messages below. \n\n");
  736. X  
  737. X  sprintf(remove,"rm %s\n",PLAYERFILE);
  738. X  system(remove);
  739. X***************
  740. X*** 26,30 ****
  741. X--- 48,69 ----
  742. X      fclose(f);
  743. X      }
  744. X  sprintf(remove,"rm %s\n",MASTERPIDFILE);
  745. X+ system(remove);
  746. X+ 
  747. X+     if ((f=fopen(PROCESSFILE,"r"))==NULL)
  748. X+         {
  749. X+         fprintf(stdout,"mpssclean : processnumber file not existent.\n");
  750. X+         exit(0);
  751. X+         } else
  752. X+         {
  753. X+         while ((fgets(arr,15,f))!=NULL)
  754. X+             {
  755. X+             sscanf(arr,"%d\n",&procno);
  756. X+             kill(procno,9);
  757. X+             fprintf(stdout,"mpssclean : killed process number : %d\n",procno);
  758. X+             }
  759. X+         fclose(f);
  760. X+         }
  761. X+ sprintf(remove,"rm %s\n",PROCESSFILE);
  762. X  system(remove);
  763. X  }
  764. X*** ../../mpss/newplayer.c    Thu Jun 23 10:22:06 1988
  765. X--- newplayer.c    Wed Jul 27 14:36:08 1988
  766. X***************
  767. X*** 1,4 ****
  768. X--- 1,5 ----
  769. X  
  770. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  771. X  /*******************************************************************************
  772. X  ********************************************************************************
  773. X  ********************************************************************************
  774. X*** ../../mpss/orbit.c    Thu Jun 23 10:22:07 1988
  775. X--- orbit.c    Wed Jul 27 14:36:08 1988
  776. X***************
  777. X*** 1,4 ****
  778. X--- 1,5 ----
  779. X  
  780. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  781. X  /*******************************************************************************
  782. X  ********************************************************************************
  783. X  ********************************************************************************
  784. X***************
  785. X*** 113,120 ****
  786. X      plot2(cp,"Most of our energy has been used to keep us in the air.  ");
  787. X      cp->energy -= 300;
  788. X      cp->maxenergy -= 300;
  789. X!     plotenergy(cp);
  790. X!     plotmaxenergy(cp);
  791. X      return(0);
  792. X      } 
  793. X  
  794. X--- 114,125 ----
  795. X      plot2(cp,"Most of our energy has been used to keep us in the air.  ");
  796. X      cp->energy -= 300;
  797. X      cp->maxenergy -= 300;
  798. X!     plotbattleenergy(cp);
  799. X!     if (cp->energy<0 && cp->reason>0) 
  800. X!             {
  801. X!             cp->reason= -12;
  802. X!             finish(cp);
  803. X!             }
  804. X      return(0);
  805. X      } 
  806. X  
  807. X*** ../../mpss/planets.c    Thu Jun 23 10:22:07 1988
  808. X--- planets.c    Wed Jul 27 14:36:09 1988
  809. X***************
  810. X*** 1,4 ****
  811. X--- 1,5 ----
  812. X  
  813. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  814. X  /*******************************************************************************
  815. X  ********************************************************************************
  816. X  ********************************************************************************
  817. X***************
  818. X*** 19,31 ****
  819. X      {
  820. X      0,220,670,
  821. X      "          Spock : We are now orbiting earth sir.         ",
  822. X!     "                ***************                          ",
  823. X!     "         ********             *********                  ",
  824. X!     "         *     Starfleet Command      *                  ",
  825. X!     "         *United Federation of Planets*                  ",
  826. X!     "         *   Starfleet Headquarters   *                  ",
  827. X!     "         ********             *********                  ",
  828. X!     "                ***************                          ",
  829. X      "Admiral Nogouchi : Welcome to Starfleet Command Kirk.    ",
  830. X      "Your mission will last for 5 years flying around the     ",
  831. X      "Galaxy to explore new life whereever you can. While you  ",
  832. X--- 20,32 ----
  833. X      {
  834. X      0,220,670,
  835. X      "          Spock : We are now orbiting earth sir.         ",
  836. X!     "                 **********************                  ",
  837. X!     "             *****                    *****              ",
  838. X!     "           ***     Starfleet Command      ***            ",
  839. X!     "         *****United Federation of Planets*****          ",
  840. X!     "           ***   Starfleet Headquarters   ***            ",
  841. X!     "             *****                    *****              ",
  842. X!     "                 **********************                  ",
  843. X      "Admiral Nogouchi : Welcome to Starfleet Command Kirk.    ",
  844. X      "Your mission will last for 5 years flying around the     ",
  845. X      "Galaxy to explore new life whereever you can. While you  ",
  846. X***************
  847. X*** 80,86 ****
  848. X      "Effect : You are now a Jedi.     /                       ",
  849. X      " This is your new weapon-->     /                        ",
  850. X      "                              /_/                        ",
  851. X!     3,400,675,
  852. X      "Spock : This is Ceti Alpha 6. Where we left Khan marooned",
  853. X      "You are standing on the planet but Khan and his crew are ",
  854. X      "nowhere to be found. However you do find a  dilithium    ",
  855. X--- 81,87 ----
  856. X      "Effect : You are now a Jedi.     /                       ",
  857. X      " This is your new weapon-->     /                        ",
  858. X      "                              /_/                        ",
  859. X!     3,400,676,
  860. X      "Spock : This is Ceti Alpha 6. Where we left Khan marooned",
  861. X      "You are standing on the planet but Khan and his crew are ",
  862. X      "nowhere to be found. However you do find a  dilithium    ",
  863. X***************
  864. X*** 374,380 ****
  865. X      "%%%%%%%%%%%%%%           .  ||             :             ",
  866. X      "%%%%%%%%%%%%%               --                           ",
  867. X      "%%%%%%%%%%%%                                             ",
  868. X!     17,300,225,
  869. X      "Spock : We are now orbiting the remote ice-world of Hoth.",
  870. X      "You arrive and ar in for a bad shock. Its freeeezing here",
  871. X      "and you decide to find shelter in a local cave. There you",
  872. X--- 375,381 ----
  873. X      "%%%%%%%%%%%%%%           .  ||             :             ",
  874. X      "%%%%%%%%%%%%%               --                           ",
  875. X      "%%%%%%%%%%%%                                             ",
  876. X!     17,300,226,
  877. X      "Spock : We are now orbiting the remote ice-world of Hoth.",
  878. X      "You arrive and ar in for a bad shock. Its freeeezing here",
  879. X      "and you decide to find shelter in a local cave. There you",
  880. X***************
  881. X*** 584,590 ****
  882. X      "                                                         ",
  883. X      "                                                         ",
  884. X      "                                                         ",
  885. X!     27,675,410,
  886. X      "Spock : We are now orbiting the klingon planet Kharse II.",
  887. X      " You find a vast computer complex and enter. You are     ",
  888. X      "surrounded by machines, lights and basically feel pretty ",
  889. X--- 585,591 ----
  890. X      "                                                         ",
  891. X      "                                                         ",
  892. X      "                                                         ",
  893. X!     27,676,410,
  894. X      "Spock : We are now orbiting the klingon planet Kharse II.",
  895. X      " You find a vast computer complex and enter. You are     ",
  896. X      "surrounded by machines, lights and basically feel pretty ",
  897. X*** ../../mpss/processinput.c    Fri Jul 15 09:51:28 1988
  898. X--- processinput.c    Wed Jul 27 14:36:09 1988
  899. X***************
  900. X*** 1,4 ****
  901. X--- 1,5 ----
  902. X  
  903. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  904. X  /*******************************************************************************
  905. X  ********************************************************************************
  906. X  ********************************************************************************
  907. X***************
  908. X*** 22,28 ****
  909. X  {
  910. X  register struct player *x,*o;
  911. X  int z;
  912. X! unsigned char c;    /* override "char c" in header.h  -- br */
  913. X  
  914. X  getbuf(cp,ptrnoofchars);
  915. X  while ((c=getchr(cp))!='\0')
  916. X--- 23,29 ----
  917. X  {
  918. X  register struct player *x,*o;
  919. X  int z;
  920. X! unsigned char c;    
  921. X  
  922. X  getbuf(cp,ptrnoofchars);
  923. X  while ((c=getchr(cp))!='\0')
  924. X***************
  925. X*** 530,537 ****
  926. X          cp->message[i]=' ';
  927. X          cp->messindex=0;
  928. X          break;
  929. X-     case 'w': plotvelocity(cp);
  930. X-           break;
  931. X      case 'e': plotenergy(cp);
  932. X            break;
  933. X      case 'd': if (cp->stat!=7) dock(cp);
  934. X--- 531,536 ----
  935. X***************
  936. X*** 592,598 ****
  937. X  impulse_message(cp)
  938. X  register struct player *cp;
  939. X  {
  940. X-         plotvelocity(cp);
  941. X          plot1(cp,"   Manoevering Impulse Thrusters only function from      ");
  942. X          plot2(cp,"   a stationary position..thrusters are overheated.      ");
  943. X  }
  944. X--- 591,596 ----
  945. X***************
  946. X*** 614,622 ****
  947. X          if (abs(cp->xvel)>cp->maxvel)
  948. X              {
  949. X              if (cp->xvel<0) ++(cp->xvel); else --(cp->xvel);
  950. X!             } else
  951. X              {
  952. X              if (cp->yvel<0) ++(cp->yvel); else --(cp->yvel);
  953. X              }
  954. X!     }
  955. X  }
  956. X--- 612,621 ----
  957. X          if (abs(cp->xvel)>cp->maxvel)
  958. X              {
  959. X              if (cp->xvel<0) ++(cp->xvel); else --(cp->xvel);
  960. X!             } 
  961. X!         if (abs(cp->yvel)>cp->maxvel)
  962. X              {
  963. X              if (cp->yvel<0) ++(cp->yvel); else --(cp->yvel);
  964. X              }
  965. X!     } else plotvelocity(cp);
  966. X  }
  967. X*** ../../mpss/scan.c    Thu Jun 23 10:22:08 1988
  968. X--- scan.c    Wed Jul 27 14:36:09 1988
  969. X***************
  970. X*** 1,4 ****
  971. X--- 1,5 ----
  972. X  
  973. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  974. X  /*******************************************************************************
  975. X  ********************************************************************************
  976. X  ********************************************************************************
  977. X*** ../../mpss/setupuniverse.c    Thu Jun 23 10:22:08 1988
  978. X--- setupuniverse.c    Wed Jul 27 14:36:09 1988
  979. X***************
  980. X*** 1,4 ****
  981. X--- 1,5 ----
  982. X  
  983. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  984. X  /*******************************************************************************
  985. X  ********************************************************************************
  986. X  ********************************************************************************
  987. X*** ../../mpss/ships.c    Thu Jun 23 10:22:08 1988
  988. X--- ships.c    Wed Jul 27 14:36:09 1988
  989. X***************
  990. X*** 1,4 ****
  991. X--- 1,5 ----
  992. X  
  993. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  994. X  /*******************************************************************************
  995. X  ********************************************************************************
  996. X  ********************************************************************************
  997. X*** ../../mpss/slave.c    Thu Jun 23 10:22:08 1988
  998. X--- slave.c    Wed Jul 27 14:36:10 1988
  999. X***************
  1000. X*** 1,4 ****
  1001. X--- 1,5 ----
  1002. X  
  1003. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1004. X  /*******************************************************************************
  1005. X  ********************************************************************************
  1006. X  ********************************************************************************
  1007. X***************
  1008. X*** 45,50 ****
  1009. X--- 46,94 ----
  1010. X          char name[10];
  1011. X          int score;
  1012. X            } sb[50];
  1013. X+ 
  1014. X+ lognewprocess(procno)
  1015. X+ int procno;
  1016. X+ {
  1017. X+ char arr[15];
  1018. X+ 
  1019. X+     if ((f=fopen(PROCESSFILE,"a"))==NULL)
  1020. X+         {
  1021. X+         fprintf(stdout,"slave.c : error trying to log processnumber\n");
  1022. X+         abnormdie();
  1023. X+         } else
  1024. X+         {
  1025. X+         sprintf(arr,"%d\n",procno);
  1026. X+         fputs(arr,f);
  1027. X+         fclose(f);
  1028. X+         }
  1029. X+ }
  1030. X+ 
  1031. X+ checkmasterpidfile()
  1032. X+ {
  1033. X+ int rpid;
  1034. X+ char string[15];
  1035. X+ FILE *ff,*fopen();
  1036. X+ 
  1037. X+ if ((ff=fopen(MASTERPIDFILE,"r"))==NULL) 
  1038. X+     {
  1039. X+     fprintf(stdout,"slave.c: Can't read masterpidfile\n");
  1040. X+     abnormdie();
  1041. X+     } else
  1042. X+     {
  1043. X+     fgets(string,15,ff); /*get pid*/
  1044. X+     fclose(ff);
  1045. X+     }
  1046. X+ sscanf(string,"%d\n",&rpid);
  1047. X+ if (rpid!=masterpid) 
  1048. X+     {
  1049. X+     fprintf(stdout,"slave.c: pids not equal!!! %d %d\n",rpid,masterpid);
  1050. X+     abnormdie();
  1051. X+     }
  1052. X+ signal(SIGALRM,checkmasterpidfile);
  1053. X+ /*fprintf(stdout,"slave.c : checked masterpid. its OK!!\n");*/
  1054. X+ alarm(20);
  1055. X+ }
  1056. X   
  1057. X  readinscores()
  1058. X  {
  1059. X***************
  1060. X*** 63,70 ****
  1061. X      } else
  1062. X      {
  1063. X      sleep(3);
  1064. X!     clrscreenslave(cl,tty_type);
  1065. X!     fprintf(stdout,"Two games were created at once. Please try again. That should work.\n");
  1066. X      return(0);
  1067. X      }
  1068. X  
  1069. X--- 107,116 ----
  1070. X      } else
  1071. X      {
  1072. X      sleep(3);
  1073. X!     fprintf(stdout,"Either the program aborted abnormally or two games were created at the same time.\n");
  1074. X!     fprintf(stdout,"If two games were created at once. Please try again. That should work.\n");
  1075. X!     fprintf(stdout,"(This is likely if you & someone else startred a game at the same instant) \n");
  1076. X!     fprintf(stdout,"If nobody else is playing and you keep getting this message, do an mpssclean!\n");
  1077. X      return(0);
  1078. X      }
  1079. X  
  1080. X***************
  1081. X*** 91,97 ****
  1082. X  
  1083. X  if (i>=50)
  1084. X      {
  1085. X!     fprintf(stdout,"\nYou did so badly, that you didn't even make the scoreboard!\n");
  1086. X      unlink(PLAYERSCOREFILE);
  1087. X      return(0);
  1088. X      }
  1089. X--- 137,143 ----
  1090. X  
  1091. X  if (i>=50)
  1092. X      {
  1093. X!     fprintf(stdout,"\n      You did so badly, that you didn't even make the scoreboard!\n");
  1094. X      unlink(PLAYERSCOREFILE);
  1095. X      return(0);
  1096. X      }
  1097. X***************
  1098. X*** 142,148 ****
  1099. X  fprintf(stdout,"\n");
  1100. X  tputs(bon,1,slaveoutc);
  1101. X  fprintf(stdout,"*****************************************************************************\n");
  1102. X! fprintf(stdout,"*                MULTI-PLAYER-STAR-TREK's ALL TIME HIGHS                    *\n");
  1103. X  fprintf(stdout,"*****************************************************************************\n");
  1104. X  tputs(boff,1,slaveoutc);
  1105. X  fprintf(stdout,"*Position Name     Ships name          Cause of Death                 Score *\n");
  1106. X--- 188,194 ----
  1107. X  fprintf(stdout,"\n");
  1108. X  tputs(bon,1,slaveoutc);
  1109. X  fprintf(stdout,"*****************************************************************************\n");
  1110. X! fprintf(stdout,"*             MULTI-PLAYER-STAR-TREK's ALL TIME HIGHS (V 1.4)               *\n");
  1111. X  fprintf(stdout,"*****************************************************************************\n");
  1112. X  tputs(boff,1,slaveoutc);
  1113. X  fprintf(stdout,"*Position Name     Ships name          Cause of Death                 Score *\n");
  1114. X***************
  1115. X*** 178,184 ****
  1116. X          write(0,"Ran out of energy in flight!!",29);
  1117. X          break;
  1118. X      case -3:
  1119. X!         write(0,"activated Selfdestruct & quit",29);
  1120. X          break;
  1121. X      case -4:
  1122. X          write(0,"Blew up under heavy attack...",29);
  1123. X--- 224,230 ----
  1124. X          write(0,"Ran out of energy in flight!!",29);
  1125. X          break;
  1126. X      case -3:
  1127. X!         write(0,"Self-destructed the ship/quit",29);
  1128. X          break;
  1129. X      case -4:
  1130. X          write(0,"Blew up under heavy attack...",29);
  1131. X***************
  1132. X*** 186,191 ****
  1133. X--- 232,258 ----
  1134. X      case -5:
  1135. X          write(0,"Tried time warping twice.....",29);
  1136. X          break;
  1137. X+     case -6:
  1138. X+         write(0,"Flew into a star.............",29);
  1139. X+         break;
  1140. X+     case -7:
  1141. X+         write(0,"Struck a Romulan warning buoy",29);
  1142. X+         break;
  1143. X+     case -8:
  1144. X+         write(0,"Hit a Klingon mevisic mine...",29);
  1145. X+         break;
  1146. X+     case -9:
  1147. X+         write(0,"Shot by a Klingon destroyer..",29);
  1148. X+         break;
  1149. X+     case -10:
  1150. X+         write(0,"Shot by a Romulan cruiser....",29);
  1151. X+         break;
  1152. X+     case -11:
  1153. X+         write(0,"Was hit by flying ship debris",29);
  1154. X+         break;
  1155. X+     case -12:
  1156. X+         write(0,"Fried in a planets atmosphere",29);
  1157. X+         break;
  1158. X      default:
  1159. X          write(0,"Burnt up over Genesis........",29);
  1160. X          break;
  1161. X***************
  1162. X*** 208,214 ****
  1163. X      exit(0);
  1164. X  }
  1165. X  
  1166. X! 
  1167. X  /*
  1168. X   *    setrawmode()    Function to set cbreak -echo for the terminal
  1169. X   */
  1170. X--- 275,287 ----
  1171. X      exit(0);
  1172. X  }
  1173. X  
  1174. X! abnormdie()
  1175. X! {
  1176. X!     fprintf(stdout,"abnormal termination of program, try mpssclean.\n");
  1177. X!     unsetrawmode();
  1178. X!     exit(0);
  1179. X! }
  1180. X!     
  1181. X  /*
  1182. X   *    setrawmode()    Function to set cbreak -echo for the terminal
  1183. X   */
  1184. X***************
  1185. X*** 288,294 ****
  1186. X  fprintf(stderr,"Try again without the -t option. If you get the same result,\n");
  1187. X  fprintf(stderr,"you must modify the code. (See rules)\n");
  1188. X  }
  1189. X!                 exit(0);
  1190. X                  }
  1191. X          } else
  1192. X          {
  1193. X--- 361,367 ----
  1194. X  fprintf(stderr,"Try again without the -t option. If you get the same result,\n");
  1195. X  fprintf(stderr,"you must modify the code. (See rules)\n");
  1196. X  }
  1197. X!                 abnormdie();
  1198. X                  }
  1199. X          } else
  1200. X          {
  1201. X***************
  1202. X*** 305,310 ****
  1203. X--- 378,385 ----
  1204. X  int childpid,i;
  1205. X  char *s;
  1206. X  char c;
  1207. X+     
  1208. X+     lognewprocess(getpid());
  1209. X      nointro=0; termcap=0;
  1210. X      while(--argc>0 && (*++argv)[0]=='-')
  1211. X          for (s=argv[0]+1; *s!='\0'; s++)
  1212. X***************
  1213. X*** 335,370 ****
  1214. X                  }
  1215. X      setrawmode();
  1216. X  
  1217. X      srand(time()%10);
  1218. X      sleep(rand()%10);
  1219. X      
  1220. X!     while ((f=fopen(LOCK,"r"))!=NULL) 
  1221. X      { 
  1222. X      fclose(f); 
  1223. X!     fprintf(stdout,"                 Your'e in the queue to join. Please wait..\n");
  1224. X!     sleep(rand()%10);
  1225. X      }
  1226. X  
  1227. X      if ((i=creat(LOCK,0666))<0)
  1228. X          fprintf(stdout,"                  Cant create LOCK file.\n");
  1229. X      
  1230. X      statflg=OFF;
  1231. X      /*CHECK IF THE MASTER IS ALREADY RUNNING!!!*/
  1232. X      if ((f=fopen(MASTERPIDFILE,"r"))==NULL)
  1233. X      {
  1234. X      /*tell others the game is starting......*/
  1235. X      char run[80];
  1236. X      sprintf(run,"%s",MAILFILE);
  1237. X      system(run);
  1238. X      /*tell others the game is starting......*/
  1239. X-     clrscreenslave(cl,tty_type);
  1240. X      
  1241. X      fprintf(stdout,"                 Invoking the game for the first player....\n");
  1242. X      fprintf(stdout,"                 This takes about 30 seconds...............\n");
  1243. X      if ((pid=fork())==0) {
  1244. X          execl(MASTERPROGRAM,"peer",">&!/dev/null","&",(char *) 0);
  1245. X          fprintf(stderr,"cannot invoke master process!");
  1246. X!                 exit();
  1247. X                   } 
  1248. X      statflg=ON;
  1249. X      i=0;
  1250. X--- 410,472 ----
  1251. X                  }
  1252. X      setrawmode();
  1253. X  
  1254. X+     fprintf(stdout,"                Please wait..this can take a moment. \n");
  1255. X      srand(time()%10);
  1256. X      sleep(rand()%10);
  1257. X      
  1258. X!     i=1;
  1259. X!     while ((i<8)&&(f=fopen(LOCK,"r"))!=NULL) 
  1260. X      { 
  1261. X+     fprintf(stdout,"            %d) Please keep waiting (timeout at 10).\n",i);
  1262. X      fclose(f); 
  1263. X!     sleep(3+rand()%10);
  1264. X!     i++;
  1265. X      }
  1266. X+     
  1267. X+     if (i==8) 
  1268. X+         {
  1269. X+         unlink(LOCK);
  1270. X+         i=0;
  1271. X+         while ((i<6)&&(f=fopen(LOCK,"r"))!=NULL) 
  1272. X+             { 
  1273. X+             fclose(f); 
  1274. X+             fprintf(stdout,"  Your'e still in the queue to join. Please be patient a little more...\n");
  1275. X+             sleep(2+rand()%10);
  1276. X+             i++;
  1277. X+             }
  1278. X+         if (i==6)
  1279. X+             {
  1280. X+         fprintf(stdout,"Can't get LOCKfile to open. Try 'mpssclean' first.\n");
  1281. X+         abnormdie();
  1282. X+             }
  1283. X+         }
  1284. X+             
  1285. X  
  1286. X      if ((i=creat(LOCK,0666))<0)
  1287. X+         {
  1288. X          fprintf(stdout,"                  Cant create LOCK file.\n");
  1289. X+         abnormdie();
  1290. X+         }
  1291. X      
  1292. X      statflg=OFF;
  1293. X      /*CHECK IF THE MASTER IS ALREADY RUNNING!!!*/
  1294. X      if ((f=fopen(MASTERPIDFILE,"r"))==NULL)
  1295. X      {
  1296. X+     
  1297. X      /*tell others the game is starting......*/
  1298. X      char run[80];
  1299. X      sprintf(run,"%s",MAILFILE);
  1300. X      system(run);
  1301. X      /*tell others the game is starting......*/
  1302. X      
  1303. X+     
  1304. X+     clrscreenslave(cl,tty_type);
  1305. X      fprintf(stdout,"                 Invoking the game for the first player....\n");
  1306. X      fprintf(stdout,"                 This takes about 30 seconds...............\n");
  1307. X      if ((pid=fork())==0) {
  1308. X          execl(MASTERPROGRAM,"peer",">&!/dev/null","&",(char *) 0);
  1309. X          fprintf(stderr,"cannot invoke master process!");
  1310. X!         abnormdie();
  1311. X                   } 
  1312. X      statflg=ON;
  1313. X      i=0;
  1314. X***************
  1315. X*** 375,383 ****
  1316. X          i++;
  1317. X          }
  1318. X      if (i==20) {
  1319. X!         fprintf(stdout,"                          mpss : timed out waiting.\n");
  1320. X           unlink(LOCK);
  1321. X!          exit(0);
  1322. X          }
  1323. X      } 
  1324. X      fgets(masterpidname,15,f);
  1325. X--- 477,485 ----
  1326. X          i++;
  1327. X          }
  1328. X      if (i==20) {
  1329. X!         fprintf(stdout,"                          mpss : timed out waiting. Do mpssclean!\n");
  1330. X           unlink(LOCK);
  1331. X!          abnormdie();
  1332. X          }
  1333. X      } 
  1334. X      fgets(masterpidname,15,f);
  1335. X***************
  1336. X*** 425,430 ****
  1337. X--- 527,533 ----
  1338. X      sleep(4);
  1339. X      fprintf(stdout,"                                before.....\n");
  1340. X      sleep(3);
  1341. X+     clrscreenslave(cl,tty_type);
  1342. X      poscursslave(cm,tty_type,0,0);
  1343. X      fprintf(stdout,"\n");
  1344. X      fprintf(stdout,"\n");
  1345. X***************
  1346. X*** 448,474 ****
  1347. X      fprintf(stdout,"     *                                                               *\n");
  1348. X      fprintf(stdout,"     * Written by Peer Schmitz, University of Keele, Keele, Staffs,  *\n");
  1349. X      fprintf(stdout,"     * ST5-5BG, Jan. - Jul 88, due to a lack of STAR TREK on the box.*\n");
  1350. X!     fprintf(stdout,"     *                       Version 1.3....                         *\n");
  1351. X      fprintf(stdout,"     *****************************************************************\n");
  1352. X!     tputs(bon,1,slaveoutc);
  1353. X!     fprintf(stdout,"\n                                Hit any key\n");
  1354. X!     tputs(boff,1,slaveoutc);
  1355. X!     read(0,&c,1);
  1356. X  nextlabel:
  1357. X      if ((pid=fork())==0)
  1358. X          {
  1359. X          childpid=getpid();
  1360. X!         while ((f=fopen(PLAYERFILE,"r"))!=NULL)
  1361. X                          {
  1362. X                          fclose(f);
  1363. X!                         sleep(((int)(time()%10)));
  1364. X                          }
  1365. X          /*Now we know the file isnt there yet*/
  1366. X          i=creat(PLAYERFILE,0666);
  1367. X          if ((f=fopen(PLAYERFILE,"w"))==NULL)
  1368. X              {
  1369. X              fprintf(stdout,"CANNOT OPEN PLAYERFILE\n");
  1370. X!             exit(0);
  1371. X              } else
  1372. X              {
  1373. X              char c;
  1374. X--- 551,601 ----
  1375. X      fprintf(stdout,"     *                                                               *\n");
  1376. X      fprintf(stdout,"     * Written by Peer Schmitz, University of Keele, Keele, Staffs,  *\n");
  1377. X      fprintf(stdout,"     * ST5-5BG, Jan. - Jul 88, due to a lack of STAR TREK on the box.*\n");
  1378. X!     fprintf(stdout,"     *                         Version 1.4....                       *\n");
  1379. X      fprintf(stdout,"     *****************************************************************\n");
  1380. X!     sleep(17);
  1381. X!     clrscreenslave(cl,tty_type);
  1382. X  nextlabel:
  1383. X      if ((pid=fork())==0)
  1384. X          {
  1385. X+         signal(SIGALRM,checkmasterpidfile);
  1386. X          childpid=getpid();
  1387. X!         lognewprocess(childpid);
  1388. X!         i=1;
  1389. X!         while ((i<5)&&((f=fopen(PLAYERFILE,"r"))!=NULL))
  1390. X                          {
  1391. X                          fclose(f);
  1392. X!     fprintf(stdout,"                     %d) Please be patient a little more...\n",i);
  1393. X!                         sleep((2+(rand()%10)));
  1394. X!                         i++;
  1395. X                          }
  1396. X+     
  1397. X+         if (i==5) 
  1398. X+         {
  1399. X+         unlink(PLAYERFILE);
  1400. X+         i=1;
  1401. X+         while ((i<6)&&(f=fopen(PLAYERFILE,"r"))!=NULL) 
  1402. X+             { 
  1403. X+             fclose(f); 
  1404. X+     fprintf(stdout,"                     %d) Please be patient a little more...\n",i);
  1405. X+     fprintf(stdout,"                        Hang in there a little more...\n");
  1406. X+     fprintf(stdout,"                        (Ill time out soon if this fails.)\n");
  1407. X+             sleep(2+rand()%10);
  1408. X+             i++;
  1409. X+             }
  1410. X+         if (i==6)
  1411. X+             {
  1412. X+         fprintf(stdout,"Can't get Playerfile to open. Try 'mpssclean' first.\n");
  1413. X+         abnormdie();
  1414. X+             }
  1415. X+         }
  1416. X+             
  1417. X          /*Now we know the file isnt there yet*/
  1418. X          i=creat(PLAYERFILE,0666);
  1419. X          if ((f=fopen(PLAYERFILE,"w"))==NULL)
  1420. X              {
  1421. X              fprintf(stdout,"CANNOT OPEN PLAYERFILE\n");
  1422. X!              abnormdie();
  1423. X              } else
  1424. X              {
  1425. X              char c;
  1426. X***************
  1427. X*** 484,489 ****
  1428. X--- 611,617 ----
  1429. X      */
  1430. X              clrscreenslave(cl,tty_type);
  1431. X              kill(masterpid,29);
  1432. X+             alarm(20);
  1433. X              while(1);
  1434. X              }
  1435. X          }
  1436. X*** ../../mpss/torpedo.c    Thu Jun 23 10:22:08 1988
  1437. X--- torpedo.c    Wed Jul 27 14:36:10 1988
  1438. X***************
  1439. X*** 1,4 ****
  1440. X--- 1,5 ----
  1441. X  
  1442. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1443. X  /*******************************************************************************
  1444. X  ********************************************************************************
  1445. X  ********************************************************************************
  1446. X***************
  1447. X*** 16,22 ****
  1448. X  
  1449. X  move_torpedos()
  1450. X  {
  1451. X! int x,y;
  1452. X  int hit;
  1453. X  struct torpedo *t,*a;
  1454. X  struct player *p,*h;
  1455. X--- 17,23 ----
  1456. X  
  1457. X  move_torpedos()
  1458. X  {
  1459. X! int x,y,ll;
  1460. X  int hit;
  1461. X  struct torpedo *t,*a;
  1462. X  struct player *p,*h;
  1463. X***************
  1464. X*** 67,72 ****
  1465. X--- 68,83 ----
  1466. X              {
  1467. X              plot1(t->whofrom,"        Direct hit on enemy Captain! Well Done!          ");
  1468. X              plot2(t->whofrom,"                                                         ");
  1469. X+         if (h->id==ROMID) 
  1470. X+                 {
  1471. X+                 h->photonpower +=10; 
  1472. X+                 h->phaserpower +=5;
  1473. X+                 }
  1474. X+         if (h->id==KLINGID)
  1475. X+                 {
  1476. X+                 h->photonpower +=5; 
  1477. X+                 h->phaserpower +=2;
  1478. X+                 }
  1479. X              }
  1480. X          t->whofrom->score += 10;
  1481. X          plotscore(t->whofrom);
  1482. X***************
  1483. X*** 87,95 ****
  1484. X--- 98,128 ----
  1485. X                  if (t->whofrom->ypos == h->ypos)
  1486. X                      {
  1487. X                      if (t->whofrom->xpos <  h->xpos)
  1488. X+                         {
  1489. X+                         if (i<75)
  1490. X                          fire_torpedo(h,'4',0);
  1491. X+                         else
  1492. X+                         {
  1493. X+                         fire_torpedo(h,'4',0);
  1494. X+                         fire_torpedo(h,'1',0);
  1495. X+                         fire_torpedo(h,'7',0);
  1496. X+                         }
  1497. X+                         }
  1498. X                          else    
  1499. X+                         if (i<75)
  1500. X                          fire_torpedo(h,'6',0);
  1501. X+                         else
  1502. X+                         {
  1503. X+                         fire_torpedo(h,'6',0);
  1504. X+                         fire_torpedo(h,'9',0);
  1505. X+                         fire_torpedo(h,'3',0);
  1506. X+                         if (i>85)
  1507. X+                             {
  1508. X+                         fire_torpedo(h,'2',0);
  1509. X+                         fire_torpedo(h,'8',0);
  1510. X+                         fire_torpedo(h,'6',0);
  1511. X+                             }
  1512. X+                         }
  1513. X                      } else
  1514. X                      {
  1515. X                      if (t->whofrom->ypos < h->ypos)
  1516. X***************
  1517. X*** 150,156 ****
  1518. X              {
  1519. X              plot1(h,"        You have been blown out of the sky!!!            ");
  1520. X              plot2(h,"       Shame the force wasn't with you this time.        ");
  1521. X!             if (h->reason>0) h->reason= -4;
  1522. X              finish(h);
  1523. X              t->whofrom->score += 100;
  1524. X              plot1(t->whofrom,"        Chekov : Got him!! Bones : He's dead Jim!        ");
  1525. X--- 183,193 ----
  1526. X              {
  1527. X              plot1(h,"        You have been blown out of the sky!!!            ");
  1528. X              plot2(h,"       Shame the force wasn't with you this time.        ");
  1529. X!     if (t->whofrom->id!=ROMID 
  1530. X!      && t->whofrom->id!=KLINGID 
  1531. X!          && h->reason>0) h->reason= -4;
  1532. X!     if (t->whofrom->id==ROMID && h->reason>0) h->reason= -10;
  1533. X!     if (t->whofrom->id==KLINGID && h->reason>0) h->reason= -9;
  1534. X              finish(h);
  1535. X              t->whofrom->score += 100;
  1536. X              plot1(t->whofrom,"        Chekov : Got him!! Bones : He's dead Jim!        ");
  1537. X***************
  1538. X*** 172,180 ****
  1539. X          {
  1540. X          plot1(h,"   You were hit by a piece of debris from the explosion! ");
  1541. X          plot2(h,"         Your energy capability has been lowered.        ");
  1542. X!         h->energy-=10;
  1543. X!         h->maxenergy-=10;
  1544. X          plotbattleenergy(h);
  1545. X          }
  1546. X      } else /*hit is off!*/
  1547. X      {
  1548. X--- 209,222 ----
  1549. X          {
  1550. X          plot1(h,"   You were hit by a piece of debris from the explosion! ");
  1551. X          plot2(h,"         Your energy capability has been lowered.        ");
  1552. X!         h->energy-=30;
  1553. X!         h->maxenergy-=30;
  1554. X          plotbattleenergy(h);
  1555. X+         if (h->energy<0 && h->reason>0) 
  1556. X+             {
  1557. X+             h->reason= -11;
  1558. X+             finish(h);
  1559. X+             }
  1560. X          }
  1561. X      } else /*hit is off!*/
  1562. X      {
  1563. X***************
  1564. X*** 186,197 ****
  1565. X          if (t->whofrom!=NULL)
  1566. X              {
  1567. X              j=which_sector(t->xpos,t->ypos,0,0);
  1568. X!             if (j==2) gethim(t->whofrom,KLINGID);
  1569. X!             if (j==3) gethim(t->whofrom,ROMID);
  1570. X!             if (j==4) {
  1571. X!                   gethim(t->whofrom,ROMID);
  1572. X!                   gethim(t->whofrom,KLINGID);
  1573. X!                   }
  1574. X              }
  1575. X          if (c=='*')
  1576. X              {
  1577. X--- 228,254 ----
  1578. X          if (t->whofrom!=NULL)
  1579. X              {
  1580. X              j=which_sector(t->xpos,t->ypos,0,0);
  1581. X!         if (j==2 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1582. X!                 {
  1583. X!                 gethim(t->whofrom,KLINGID);
  1584. X!                 gethim(t->whofrom,KLINGID);
  1585. X!                 gethim(t->whofrom,KLINGID);
  1586. X!                 gethim(t->whofrom,KLINGID);
  1587. X!                 }
  1588. X!         if (j==3 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1589. X!                 {
  1590. X!                 gethim(t->whofrom,ROMID);
  1591. X!                 gethim(t->whofrom,ROMID);
  1592. X!                 gethim(t->whofrom,ROMID);
  1593. X!                 gethim(t->whofrom,ROMID);
  1594. X!                 }
  1595. X!         if (j==4 && t->whofrom->id!=ROMID && t->whofrom->id!=KLINGID) 
  1596. X!                 {
  1597. X!                 for (ll=1;ll<MAXALIENS;ll++)   
  1598. X!                     gethim(t->whofrom,ROMID);
  1599. X!                 for (ll=1;ll<MAXALIENS;ll++)   
  1600. X!                     gethim(t->whofrom,KLINGID);
  1601. X!                 }
  1602. X              }
  1603. X          if (c=='*')
  1604. X              {
  1605. X*** ../../mpss/files.h    Thu Jun 23 10:22:09 1988
  1606. X--- files.h    Wed Jul 27 14:36:10 1988
  1607. X***************
  1608. X*** 1,4 ****
  1609. X--- 1,5 ----
  1610. X  
  1611. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1612. X  /*******************************************************************************
  1613. X  ********************************************************************************
  1614. X  ********************************************************************************
  1615. X***************
  1616. X*** 13,19 ****
  1617. X  ********************************************************************************
  1618. X  *******************************************************************************/
  1619. X  
  1620. X- 
  1621. X  #define SLAVEPROGRAM "/usr/games/mpsslib/slave"
  1622. X  #define MASTERPROGRAM "/usr/games/mpsslib/startrek"
  1623. X  
  1624. X--- 14,19 ----
  1625. X***************
  1626. X*** 24,27 ****
  1627. X--- 24,28 ----
  1628. X  #define SCOREFILE "/usr/games/mpsslib/score"
  1629. X  #define PLAYERSCOREFILE "/usr/games/mpsslib/playerscore"
  1630. X  #define MAILFILE "/usr/games/mpsslib/mpssmail"
  1631. X+ #define PROCESSFILE "/tmp/processnos"
  1632. X  
  1633. X*** ../../mpss/header.h    Thu Jun 23 10:22:09 1988
  1634. X--- header.h    Wed Jul 27 14:36:10 1988
  1635. X***************
  1636. X*** 1,4 ****
  1637. X--- 1,5 ----
  1638. X  
  1639. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1640. X  /*******************************************************************************
  1641. X  ********************************************************************************
  1642. X  ********************************************************************************
  1643. X***************
  1644. X*** 22,28 ****
  1645. X  #define STARTENERGY 500 
  1646. X  #define STARTPHASER 15
  1647. X  #define STARTPHOTON 10
  1648. X! #define WEAPONREACH 6
  1649. X  #define PHOTONPOWER 60
  1650. X  #define PHASERPOWER 40
  1651. X  #define MAXWARP 1
  1652. X--- 23,29 ----
  1653. X  #define STARTENERGY 500 
  1654. X  #define STARTPHASER 15
  1655. X  #define STARTPHOTON 10
  1656. X! #define WEAPONREACH 8 
  1657. X  #define PHOTONPOWER 60
  1658. X  #define PHASERPOWER 40
  1659. X  #define MAXWARP 1
  1660. X***************
  1661. X*** 31,37 ****
  1662. X  #define OFF 0
  1663. X  #define ROMID 'R'
  1664. X  #define KLINGID 'K'
  1665. X! #define MAXALIENS 3
  1666. X  
  1667. X  
  1668. X  struct sgttyb params;
  1669. X--- 32,38 ----
  1670. X  #define OFF 0
  1671. X  #define ROMID 'R'
  1672. X  #define KLINGID 'K'
  1673. X! #define MAXALIENS 6
  1674. X  
  1675. X  
  1676. X  struct sgttyb params;
  1677. X***************
  1678. X*** 100,105 ****
  1679. X--- 101,107 ----
  1680. X      int xvel;
  1681. X      int yvel;
  1682. X      int maxvel;
  1683. X+     int screenenergy;
  1684. X      int energy;
  1685. X      int maxenergy;
  1686. X      int cloakingdevice;
  1687. X*** ../../mpss/planets.h    Thu Jun 23 10:22:09 1988
  1688. X--- planets.h    Wed Jul 27 14:36:10 1988
  1689. X***************
  1690. X*** 1,4 ****
  1691. X--- 1,5 ----
  1692. X  
  1693. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1694. X  /*******************************************************************************
  1695. X  ********************************************************************************
  1696. X  ********************************************************************************
  1697. X*** ../../mpss/ships.h    Thu Jun 23 10:22:09 1988
  1698. X--- ships.h    Wed Jul 27 14:36:10 1988
  1699. X***************
  1700. X*** 1,4 ****
  1701. X--- 1,5 ----
  1702. X  
  1703. X+ /********VERSION 1.4!!! (Files from different Versions are INCOMPATIBLE!*******/
  1704. X  /*******************************************************************************
  1705. X  ********************************************************************************
  1706. X  ********************************************************************************
  1707. END_OF_FILE
  1708. if test 48433 -ne `wc -c <'Patches01'`; then
  1709.     echo shar: \"'Patches01'\" unpacked with wrong size!
  1710. fi
  1711. # end of 'Patches01'
  1712. fi
  1713. echo shar: End of shell archive.
  1714. exit 0
  1715.